package com.example.demo.controller;


import com.example.demo.mapper.UserMapper;
import com.example.demo.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class TestController {

    @Autowired
    UserMapper userMapper;

    @RequestMapping("/test")
    public List<User> test() {
        List<User> userList = userMapper.queryUserList();
        System.out.println("111111111");
        return userList;
    }

    @GetMapping("/test2")
    public User test2() {
        User user = userMapper.queryUserByName("李四");
        System.out.println("result:" + user);
        return user;
    }
}
